#include <iostream>
#include <string>
using namespace std;
bool isCircal(const string& str)
{
	int left = 0, right = str.size() - 1;
	while (left < right)
	{
		if (str[left++] != str[right--])
		{
			return false;
		}
	}
	return true;;
}
int main()
{
	string s1, s2;
	getline(cin, s1);
	getline(cin, s2);
	int cnt = 0;
	for (int i = 0; i <= s1.size(); ++i)
	{
		string tmp = s1;
		if (isCircal(tmp.insert(i, s2)))
		{
			++cnt;
		}
	}
	cout << cnt;
	return 0;
}